<template>
  <el-row :gutter="15" class="panel-group">
    <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span class="f16 fb">招聘<!-- （{{ dataBody?dataBody.onLineJobCount+dataBody.newResumeCount:0 }}） --></span>
          <el-button style="float: right; padding: 3px 0" type="text" @click.native="goList('position')"><i class="el-icon-arrow-right text-666" /></el-button>
        </div>
        <ul class="card-content">
          <li class="item">
            <div class="clearfix">
              <div class="fl text-666">在招职位</div>
              <div class="fr text-333">{{ dataBody?dataBody.onLineJobCount:0 }}</div>
            </div>
          </li>
          <li class="item">
            <div class="clearfix">
              <div class="clearfix">
                <div class="fl text-666">新简历</div>
                <div class="fr text-333">{{ dataBody?dataBody.newResumeCount:0 }}</div>
              </div>
            </div>
          </li>
        </ul>
      </el-card>
    </el-col>
    <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span class="f16 fb">面试<!-- （{{ dataBody?dataBody.noInterviewCount+dataBody.processedInterviewCount:0 }}） --></span>
          <el-button style="float: right; padding: 3px 0;" type="text" @click.native="goList('interview')"><i class="el-icon-arrow-right text-666" /></el-button>
        </div>
        <ul class="card-content">
          <li class="item">
            <div class="clearfix">
              <div class="fl text-666">待面试</div>
              <div class="fr text-333">{{ dataBody?dataBody.noInterviewCount:0 }}</div>
            </div>
          </li>
          <li class="item">
            <div class="clearfix">
              <div class="clearfix">
                <div class="fl text-666">已面试待处理</div>
                <div class="fr text-333">{{ dataBody?dataBody.processedInterviewCount:0 }}</div>
              </div>
            </div>
          </li>
        </ul>
      </el-card>
    </el-col>
    <el-col :xs="8" :sm="8" :lg="8" class="card-panel-col">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span class="f16 fb">录用<!-- （{{ dataBody?dataBody.noEmployedCount+dataBody.noEntryCount:0 }}） --></span>
          <el-button style="float: right; padding: 3px 0" type="text" @click.native="goList('employ')"><i class="el-icon-arrow-right text-666" /></el-button>
        </div>
        <ul class="card-content">
          <li class="item">
            <div class="clearfix">
              <div class="fl text-666">待录用</div>
              <div class="fr text-333">{{ dataBody?dataBody.noEmployedCount:0 }}</div>
            </div>
          </li>
          <li class="item">
            <div class="clearfix">
              <div class="clearfix">
                <div class="fl text-666">待入职</div>
                <div class="fr text-333">{{ dataBody?dataBody.noEntryCount:0 }}</div>
              </div>
            </div>
          </li>
        </ul>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
import { indexMessage } from '@/api/index'
export default {
  components: {
  },
  data() {
    return {
      dataBody: null
    }
  },
  mounted() {
    indexMessage().then(response => {
      this.dataBody = response.result
    })
  },
  methods: {
    goList(e) {
      if (e === 'employ') {
        this.$router.push({ path: 'dashboard/employList' })
      } else if (e === 'position') {
        this.$router.push({ path: 'positionmanage/index' })
      } else {
        this.$router.push({ path: 'dashboard/interviewList' })
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.panel-group {
  .card-panel-col {
    margin-bottom: 15px;
  }
  .box-card{
    height: 180px;
    .card-content{
      padding: 0;
      margin: 0;
      list-style: none;
      font-size: 14px;
      margin-bottom: -10px;
      line-height: 34px;
      .item{
        margin-bottom: 10px;
      }
    }
  }
}
</style>
